package twentyOne;

import nineteen.Generator;

/**
 * 共享受限资源
 *
 * @author sun.ye
 * @since 2020-05-03 21:41
 */
public abstract class IntGenerator {
    private volatile boolean canceled = false;
    public abstract int next();
    public void cancel(){
        canceled = true;
    }
    public boolean isCanceled(){
        return canceled;
    }
}